package org.anachronos.jeep.core.timer;

import java.util.logging.Logger;

import org.anachronos.jeep.core.timer.impl.WallClockTimer;

/**
 * Factory for timer singleton object.
 * 
 * @author km
 */
public class TimerFactory {
	private static final Logger logger = Logger.getLogger(TimerFactory.class
			.getName());

	private static Timer instance;

	private TimerFactory() {
	}

	/**
	 * Get the timer singleton.
	 * 
	 * @return timer to use for execution time measurement
	 */
	public synchronized static Timer get() {
		if (instance == null) {
			logger.warning("Using wall clock time!");
			instance = new WallClockTimer();
		}
		return instance;
	}
}
